﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using DreamIn.Structures.Utils;
namespace DreamIn
{
	/// <summary>
	/// Interaction logic for RegisterUser.xaml
	/// </summary>
	public partial class RegisterUser : Window
	{
		public RegisterUser()
		{
			this.InitializeComponent();
			
			// Insert code required on object creation below this point.
		}

		private void cancel_bt_Click(object sender, System.Windows.RoutedEventArgs e)
		{
			Close();
		}

		private void register_bt_Click(object sender, System.Windows.RoutedEventArgs e)
		{
		  if(Account.Register(usernamebox.Text,passwordbox.Password,countrybox.Text)) Close();
		  else{ error_show.Text="Username Exists";
			    usernamebox.Text="";
			    passwordbox.Password="";
		}
		}
	}
}